/**  
* @Title: BaseAdminController.java  
* @Package com.shuodao.equalizer.controller.admin  
* @Description: TODO(用一句话描述该文件做什么)  
* @author Mr.zhao  
* @date 2018年4月8日  
* @version V1.0  
*/ 
package com.chuan.base.controller.admin;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.chuan.base.controller.BaseController;
import com.shuodao.common.model.AdminUser;
import com.shuodao.common.util.RequestUtil;

/**
 * @author Mr.zhao
 * @date 2018年4月8日
 *
 */
@Controller
@RequestMapping("/admin/**")
public class BaseAdminController extends BaseController{
	
	protected static final int PAGE_LENGTH = 20;
	protected static final String NAMESPACE = "admin";	
	public static final String SESSION_KEY_ADMIN = "adminUser";	
	
	@Override
	protected String ftl(String ftlFileName) {
		return NAMESPACE + "/" + ftlFileName;
	}
	
	public AdminUser getAdminUser() {		
		return (AdminUser) RequestUtil.getSession().getAttribute("adminUser");
	}
	
	public String getRefererUrl() {		
		return RequestUtil.getRequest().getHeader("referer");
	}
}
